package com.endurance.service;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class LifeCycleService implements InitializingBean, DisposableBean {

    @Override
    public void destroy() throws Exception {
        System.out.println("调用Bean的销毁回调1...");
        // do something...

    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("调用Bean的初始化回调1...");
        // do something...
    }

    @Override
    public String toString() {
        return "LifeCycleService{}";
    }
}
